package com.cy.chatTest.db;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;

@Repository
public interface MessageInfoRepository extends JpaRepository<MessageInfo,Long>{


    List<MessageInfo> findMessageInfosByToUsername(String toUsername);

    @Transactional
    void deleteAllByToUsername(@Param("toUsername") String toUsername);
}
